package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

func main() {
	//str, _ := os.Getwd()
	//fmt.Println(str)

	file, error := os.Open("/Users/super/develop/goIsAmazing/goBasis/src/fundation/test.txt")
	if error != nil {
		fmt.Println("open file error = ", error)
	}

	defer file.Close()

	//默认缓冲区大小4096
	reader := bufio.NewReader(file)
	for {
		str, err := reader.ReadString('\n')
		if err == io.EOF{
			break
		}
		fmt.Print(str)
	}
	fmt.Println("ok")
}